<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Parallel Gaussian Process Regression: psvm::GPPredictor Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Parallel Gaussian Process Regression
   &#160;<span id="projectnumber">1.0.0</span>
   </div>
   <div id="projectbrief">The implementation of parallel Gaussian process (GP) regression is based on the following publication: Jie Chen, Nannan Cao, Kian Hsiang Low, Ruofei Ouyang, Colin Keng-Yan Tan &amp; Patrick Jaillet. Parallel Gaussian Process Regression with Low-Rank Covariance Matrix Approximations. In Proceedings of the 29th Conference on Uncertainty in Artificial Intelligence (UAI 2013), Bellevue, WA, Jul 11-15, 2013.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>psvm</b></li><li class="navelem"><a class="el" href="classpsvm_1_1_g_p_predictor.html">GPPredictor</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classpsvm_1_1_g_p_predictor-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">psvm::GPPredictor Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Predict the labels of test cases with parallel ICF Gaussian Process.  
 <a href="classpsvm_1_1_g_p_predictor.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="pgpr__picf__predict_8h_source.html">pgpr_picf_predict.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a401b72ee3267f091714ace9e0973bf01"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpsvm_1_1_g_p_predictor.html#a401b72ee3267f091714ace9e0973bf01">ModelPredict</a> (string &amp;train_file, string &amp;test_file, double rank_ratio)</td></tr>
<tr class="memdesc:a401b72ee3267f091714ace9e0973bf01"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function prodvides the final interface to use the train file to predict all cases in test file.  <a href="#a401b72ee3267f091714ace9e0973bf01">More...</a><br/></td></tr>
<tr class="separator:a401b72ee3267f091714ace9e0973bf01"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7141bfbe2731cf1ebcf7579da171b9a4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpsvm_1_1_g_p_predictor.html#a7141bfbe2731cf1ebcf7579da171b9a4">GetMean</a> (double *val, int len)</td></tr>
<tr class="memdesc:a7141bfbe2731cf1ebcf7579da171b9a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function return the mean to a vector of double, user need to allocate space for the vector and destroy the vector after use.  <a href="#a7141bfbe2731cf1ebcf7579da171b9a4">More...</a><br/></td></tr>
<tr class="separator:a7141bfbe2731cf1ebcf7579da171b9a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4c6662484395256ef10a337112022222"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpsvm_1_1_g_p_predictor.html#a4c6662484395256ef10a337112022222">GetVariance</a> (double *val, int len)</td></tr>
<tr class="memdesc:a4c6662484395256ef10a337112022222"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function return the variance to a vector of double, user need to allocate space for the vector and destroy the vector after use.  <a href="#a4c6662484395256ef10a337112022222">More...</a><br/></td></tr>
<tr class="separator:a4c6662484395256ef10a337112022222"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a344dac46576dee127f0bf8e67cf53314"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpsvm_1_1_g_p_predictor.html#a344dac46576dee127f0bf8e67cf53314">GetTrueValue</a> (double *val, int len)</td></tr>
<tr class="memdesc:a344dac46576dee127f0bf8e67cf53314"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns the true values of test cases to a vector of double, user need to allocate space for the vector and destroy the vector after use.  <a href="#a344dac46576dee127f0bf8e67cf53314">More...</a><br/></td></tr>
<tr class="separator:a344dac46576dee127f0bf8e67cf53314"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae6d9145653cef7c2c396a6a00b4d00f4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpsvm_1_1_g_p_predictor.html#ae6d9145653cef7c2c396a6a00b4d00f4">SaveResult</a> (const char *file_name)</td></tr>
<tr class="memdesc:ae6d9145653cef7c2c396a6a00b4d00f4"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function save the time, true values, predicted means, variance into one file.  <a href="#ae6d9145653cef7c2c396a6a00b4d00f4">More...</a><br/></td></tr>
<tr class="separator:ae6d9145653cef7c2c396a6a00b4d00f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad4ead64375a1da166962e28810d7673e"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpsvm_1_1_g_p_predictor.html#ad4ead64375a1da166962e28810d7673e">GetRunTime</a> ()</td></tr>
<tr class="memdesc:ad4ead64375a1da166962e28810d7673e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the running time.  <a href="#ad4ead64375a1da166962e28810d7673e">More...</a><br/></td></tr>
<tr class="separator:ad4ead64375a1da166962e28810d7673e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a07da10ffdadaa7f0950d684f32d1b270"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a07da10ffdadaa7f0950d684f32d1b270"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>SetRunTime</b> (double time_)</td></tr>
<tr class="separator:a07da10ffdadaa7f0950d684f32d1b270"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a090b81645d43ce348b1fb0c2175603d5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a090b81645d43ce348b1fb0c2175603d5"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>GPPredictor</b> (string &amp;hp_file)</td></tr>
<tr class="separator:a090b81645d43ce348b1fb0c2175603d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Predict the labels of test cases with parallel ICF Gaussian Process. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a7141bfbe2731cf1ebcf7579da171b9a4"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void psvm::GPPredictor::GetMean </td>
          <td>(</td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>val</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>This function return the mean to a vector of double, user need to allocate space for the vector and destroy the vector after use. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">val</td><td>vector to store values of mean </td></tr>
    <tr><td class="paramname">len</td><td>length of vector </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ad4ead64375a1da166962e28810d7673e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">double psvm::GPPredictor::GetRunTime </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the running time. </p>
<dl class="section return"><dt>Returns</dt><dd>time used for predict mean and predict variance </dd></dl>

</div>
</div>
<a class="anchor" id="a344dac46576dee127f0bf8e67cf53314"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void psvm::GPPredictor::GetTrueValue </td>
          <td>(</td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>val</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>This function returns the true values of test cases to a vector of double, user need to allocate space for the vector and destroy the vector after use. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">val</td><td>vector to store values of variances </td></tr>
    <tr><td class="paramname">len</td><td>length of vector </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a4c6662484395256ef10a337112022222"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void psvm::GPPredictor::GetVariance </td>
          <td>(</td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>val</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>This function return the variance to a vector of double, user need to allocate space for the vector and destroy the vector after use. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">val</td><td>vector to store values of variances </td></tr>
    <tr><td class="paramname">len</td><td>length of vector </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a401b72ee3267f091714ace9e0973bf01"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void psvm::GPPredictor::ModelPredict </td>
          <td>(</td>
          <td class="paramtype">string &amp;&#160;</td>
          <td class="paramname"><em>train_file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">string &amp;&#160;</td>
          <td class="paramname"><em>test_file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>rank_ratio</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function prodvides the final interface to use the train file to predict all cases in test file. </p>
<p>This function will provide the interface to do predicting. It simply does parallel ICF then does prediction. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">train_file</td><td>the train file each line formatted as: label 0:value 1:value ... </td></tr>
    <tr><td class="paramname">test_file</td><td>the test file, each line formatted as train file </td></tr>
    <tr><td class="paramname">rank_ratio</td><td>the support rank / total number of observations </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ae6d9145653cef7c2c396a6a00b4d00f4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void psvm::GPPredictor::SaveResult </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>file_name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function save the time, true values, predicted means, variance into one file. </p>
<p>The format is like this, first line is time, then other lines are values of true labels, mean, variance. format: time time time trueLabel mean var trueLabel mean var ... </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">file_name</td><td>File name to store those values </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/<a class="el" href="pgpr__picf__predict_8h_source.html">pgpr_picf_predict.h</a></li>
<li>src/pgpr_picf_predict.cc</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Jul 29 2014 17:58:35 for Parallel Gaussian Process Regression by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
